package com.jayqqaa12;

import java.io.File;
import java.io.IOException;
import java.util.List;

import com.google.common.collect.Lists;
import com.jayqqaa12.jbase.util.Fs;

public class FindSec {

	private static String src1 = "D:/git/game/jump/Classes";
	private static String src2 = "D:/git/game/jump/Classes";

	public static void main(String[] args) {

		List<String> list = Lists.newArrayList();

		getAllFiles(new File(src1), list);
		getAllFiles(new File(src2), list);

		
		System.out.println("start get file");
		for (String path : list) {

			try {
				String str = Fs.readFile(new File(path)).trim();

				if (str.contains("include")||str.contains("ifndef")||str.contains("pragma") || str.contains("/*") || str.contains("//"));
				else {
					System.out.println(str.substring(0, 8));
					System.out.println(path);
					
				}
				

			} catch (IOException e) {

			}

		}
		System.out.println("end get file");
	}

	final static List<String> getAllFiles(File dir, List<String> list) {

		try {
			File[] fs = dir.listFiles();
			for (int i = 0; i < fs.length; i++) {
				if (fs[i].isDirectory()) {
					getAllFiles(fs[i], list);
				} else list.add(fs[i].getAbsolutePath());
			}
		} catch (Exception e) {}

		return list;
	}

}
